# Maintainer: Ivan Semkin (ivan at semkin dot ru)

pkgname=history-service-git
_pkgname=history-service
pkgver=r940.75af530
pkgrel=2
pkgdesc='History service to store messages and calls'
url='https://github.com/ubports/history-service'
arch=(x86_64 i686 armv7h aarch64)
license=(GPL)
conflicts=(history-service)
provides=(history-service)
depends=(lcov gcovr libphonenumber telepathy-qt sqlite telepathy-mission-control qt-gstreamer qt5-pim-git)
makedepends=(git cmake)
source=('git+https://github.com/ubports/history-service.git')
sha256sums=('SKIP')

# --   Package 'QtGLib-2.0', required by 'virtual:world', not found (qt-gstreamer)
BUILDENV+=('!check') # https://paste.ubuntu.com/p/hR9tBFXJ6Y/

prepare() {
  cd ${_pkgname}
  git checkout bionic
}

pkgver() {
  cd ${_pkgname}
  echo "r$(git rev-list --count HEAD).$(git describe --always)"
}

build() {
  cd ${_pkgname}
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR="lib/" .
  make
}

check() {
  cd ${_pkgname}
  make ARGS+="--output-on-failure" test
}

package() {
  cd ${_pkgname}
  make DESTDIR="${pkgdir}/" install
}
# vim:set ts=2 sw=2 et:
